<script type="text/javascript">
$(document).ready(function(){ 
	$("#form").submit(function(){
		url = $("#url").val();
		var reg = /http:\/\/hi.baidu.com\/[^\/]*/;
		if (reg.exec(url)){
			
//			alert('success');
			return true;
		}else{
			alert('您输入的地址格式不正确!');
			return false;
		}
	});
});
</script>
<form action="#" method="post" id="form">
	百度空间地址: <input type="text" name="url" id="url" style="width:300px;"> <input type="submit" value="提交">
	
	<span style="color:Grey;">地址格式: http://hi.baidu.com/<span style="color:red;">xxxx</span></span>
</from>
<div style="color:red;padding:10px;">
	{{ msg }}
</div>


 